/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fr.cggveritas.crewintranet.jms.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Alassane
 */
@Entity
@Table(name = "cv_telephonetavaleur")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "CvTelephonetavaleur.findAll", query = "SELECT c FROM CvTelephonetavaleur c"),
    @NamedQuery(name = "CvTelephonetavaleur.findById", query = "SELECT c FROM CvTelephonetavaleur c WHERE c.id = :id"),
    @NamedQuery(name = "CvTelephonetavaleur.findByTypetelephone", query = "SELECT c FROM CvTelephonetavaleur c WHERE c.typetelephone = :typetelephone"),
    @NamedQuery(name = "CvTelephonetavaleur.findByNumerotelephone", query = "SELECT c FROM CvTelephonetavaleur c WHERE c.numerotelephone = :numerotelephone")})
public class CvTelephonetavaleur implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Column(name = "typetelephone")
    private String typetelephone;
    @Column(name = "numerotelephone")
    private String numerotelephone;
    @JoinColumn(name = "cv_pays_id", referencedColumnName = "id")
    @ManyToOne(fetch = FetchType.LAZY)
    private CvPays cvPaysId;
    @JoinColumn(name = "cv_travailleur_id", referencedColumnName = "id")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private CvTravailleur cvTravailleurId;

    public CvTelephonetavaleur() {
    }

    public CvTelephonetavaleur(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTypetelephone() {
        return typetelephone;
    }

    public void setTypetelephone(String typetelephone) {
        this.typetelephone = typetelephone;
    }

    public String getNumerotelephone() {
        return numerotelephone;
    }

    public void setNumerotelephone(String numerotelephone) {
        this.numerotelephone = numerotelephone;
    }

    public CvPays getCvPaysId() {
        return cvPaysId;
    }

    public void setCvPaysId(CvPays cvPaysId) {
        this.cvPaysId = cvPaysId;
    }

    public CvTravailleur getCvTravailleurId() {
        return cvTravailleurId;
    }

    public void setCvTravailleurId(CvTravailleur cvTravailleurId) {
        this.cvTravailleurId = cvTravailleurId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CvTelephonetavaleur)) {
            return false;
        }
        CvTelephonetavaleur other = (CvTelephonetavaleur) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "fr.cggveritas.crewintranet.jms.entities.CvTelephonetavaleur[ id=" + id + " ]";
    }
    
}
